home *** CD-ROM | disk | FTP | other *** search
/ Computerized Investing - Spreadsheet Collection / Spreadsheet Collection.iso / pc / ibm11 / ytm.doc < prev    next >
Encoding:
Text File  |  1991-07-12  |  5.5 KB  |  121 lines

  1. July/August 1989, Computerized Investing
  2. A True Yield to Maturity Calculation Macro
  3. by Ed Garner with Fred Shipley
  4.  
  5. In this column we give you a means of determining a bond's
  6. true yield to maturity (YTM) for the bond management
  7. worksheet that appeared in the January/February issue of
  8. Computerized Investing (BONDMGMT.WKS).  It can also be ap-
  9. plied to the bond section of the portfolio management
  10. worksheet (PORTMGMT.WKS on disk 12 and BBS) that appeared in
  11. the March/April issue. When we cite the "original"
  12. spreadsheet here, however, we will be referring to the
  13. Jan./Feb. bond management worksheet. The macro iterates a
  14. number of times to get the true yield.
  15.  
  16. In creating this macro, we have added an extra column or two
  17. of calculations to make summing totals a little easier. By
  18. using the @SUM function in 1-2-3, the figures will still be
  19. correct when new rows, representing new bonds, are added to
  20. the portfolio. These calculations can also be added to the
  21. portfolio management worksheet. The new versions will be
  22. loaded on the CI BBS.
  23.  
  24. Area for Additional Calculations
  25.  
  26. To set up the spreadsheet to handle these calculations, you
  27. must add a few columns of data to the right of the existing
  28. calculations area, which extends to cell AE. These columns
  29. perform preliminary calculations so that the total initial
  30. cost (column AF) and the average maturity (column AG) may be
  31. computed by summing the values in these columns. When a new
  32. bond is added to the worksheet, or a bond is deleted because
  33. it has been sold, the summation formula, @SUM, remains valid.
  34.  
  35. Originally, we programmed the formula to determine the
  36. weighted average maturity by taking the maturity of each bond
  37. and multiplying it by the percentage of the portfolio that
  38. the bond comprises. This formula does not adjust when you add
  39. or delete a row as a result of bond transactions. To get
  40. around this problem, simply add a column where these
  41. multiplications can be carried out. Then you can use the @SUM
  42. function on those rows. When you insert a row for a new bond,
  43. or delete a row because you have sold a bond, the @SUM
  44. function remains accurate.
  45.  
  46. A True Yield Calculation for Zero Coupon Issues
  47.  
  48. In the original spreadsheet, we used the same approximation
  49. formula for yield to maturity for both the coupon-paying and
  50. zero coupon issues. Since we are determining an exact yield
  51. for the coupon-paying issues, we must also determine an exact
  52. yield for any zeros in our portfolio. The iterative macro
  53. will not work for zeros since there is no periodic coupon.
  54.  
  55. Since a zero coupon bond has only one payment at maturity, it
  56. is not difficult to use the formula for determining the
  57. present value of that payment. That formula is:
  58.  
  59. AK33: ((100/$G$33)^(1/(($D33-@DATE($D$4-1900,$C$4,$B$4))/
  60. 365.25))-1)/2
  61.  
  62. This formula first determines the ratio of the future value
  63. of the bond to its current price. The future value is then
  64. discounted by a power equal to the number of years until the
  65. bond matures. The final number is divided by 2 to put the
  66. yield on a semiannual basis. This formula should be copied to
  67. cell AI33.
  68.  
  69. How the Macro Works
  70.  
  71. A macro is just a series of commands that 1-2-3 recognizes
  72. and executes automatically. Macros are given a letter name,
  73. and we use the letter Y for yield. Macros are started by
  74. holding down the ALT key and the letter of the macro
  75. simultaneously. This combination is indicated by ALT-Y. To
  76. give the macro a name, use the /Range Name command. If you
  77. enter '\Y into cell A41, you can use the /Range Name Label
  78. Right command to automatically give cell B41 the name \Y. 1-
  79. 2-3 recognizes the backslash as a symbol for the ALT key. A
  80. macro implements the commands in cell B41 and any non-blank
  81. cell below B41 until it reaches a blank line. At that point
  82. the macro stops executing commands.
  83.  
  84. The {windowsoff} command turns off the redisplay of the
  85. current windows.  This command is unique to Release 2 of 1-2-
  86. 3; its purpose is to speed up the recalculation process. Then
  87. the macro uses the approximation formula in column AI to get
  88. a starting estimate for the true yield to maturity. The value
  89. of this formula is then copied to the column labeled Est YTM
  90. (column AJ). Another calculation is performed and an average
  91. of the two yields calculated in column AL. This average is
  92. copied to column AJ, Est YTM, and the procedure iterates
  93. again. The process is repeated 15 times, using the FOR
  94. command. The FOR command has the following syntax:
  95.  
  96. {FOR,counter,start,stop,step,MACRO}
  97.  
  98. This loops through MACRO, starting with the step indicated by
  99. start, stopping at the step indicated by stop, and
  100. incrementing the amount indicated by step, using the location
  101. indicated by counter as the means of keeping track of the
  102. iterations. Our loop has the form:
  103.  
  104. {for COUNTER,1,15,1,CALC}.
  105.  
  106. This loops through the macro called CALC 15 times in steps of
  107. 1. The cell labeled COUNTER is reset to 16 after completion
  108. of the macro. If you were to view that cell you would see it
  109. change as the macro iterated.
  110.  
  111. You can check to see if you have the true yield to maturity
  112. by observing if the values in columns AJ, AK and AL are the
  113. same. If so, you have determined the true yield to maturity.
  114. If not, invoke the macro ALT-I, which is part of the original
  115. macro, to do another 15 calculations. Except for bonds
  116. selling at great differences from par, 15 iterations should
  117. be sufficient. The {windowson} command resets the spreadsheet
  118. to its default setting when the macro is complete.
  119.  
  120. (C) Copyright 1991 by the
  121. American Association of Individual Investors